package com.mvc.web.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mvc.web.main.vo.SerachConditionVo;
import com.mvc.web.user.dao.UserDao;
import com.mvc.web.user.service.UserService;
import com.mvc.web.user.vo.UserVo;

@Service
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserDao userDao;

	@Override
	@Transactional(readOnly=false,rollbackFor=Throwable.class)
	public Integer doRegist(UserVo vo) {
		int id = userDao.doRegist(vo);
		System.out.println(id);
		//创建历史记录
		return id;
	}

	@Override
	public List<UserVo> getList(SerachConditionVo vo) {
		return userDao.getList(vo);
	}

	@Override
	public long getCount(SerachConditionVo vo) {
		return userDao.getCount(vo);
	}

	@Override
	public UserVo getUserById(Integer uid) {
		return userDao.getUserById(uid);
	}

}
